package com.surfilter.mq.job;

import com.surfilter.funds.task.dao.StatDaoImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class StatCountBaseJob {
	private static final Logger logger = LoggerFactory
			.getLogger(StatCountBaseJob.class);

	protected int threadNum = 10;
	protected int batchNum = 1000;

	private boolean enable;

	private String curStatVersion;

	private String taskName;

	@Autowired
	private StatDaoImpl statDaoImpl;

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public void setCurStatVersion(String curStatVersion) {
		this.curStatVersion = curStatVersion;
	}

	public StatDaoImpl getStatDaoImpl() {
		return statDaoImpl;
	}

	public void setStatDaoImpl(StatDaoImpl statDaoImpl) {
		this.statDaoImpl = statDaoImpl;
	}

	public String getCurStatVersion() {
		return curStatVersion;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public boolean isEnable() {
		if (!this.enable) {
//			logger.info("{},未开启统计服务！", getTaskName());
			return false;
		}
		return true;
	}

	public boolean finish() {
		logger.info("{},统计已完成！", getTaskName());
		return true;
	}
}
